/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cabs.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author HaoPT
 */
@Entity
@Table(name = "enquiry", catalog = "DB_Radio_Cabs", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Enquiry.findAll", query = "SELECT e FROM Enquiry e"),
    @NamedQuery(name = "Enquiry.findById", query = "SELECT e FROM Enquiry e WHERE e.id = :id"),
    @NamedQuery(name = "Enquiry.findByName", query = "SELECT e FROM Enquiry e WHERE e.name = :name"),
    @NamedQuery(name = "Enquiry.findByEmail", query = "SELECT e FROM Enquiry e WHERE e.email = :email"),
    @NamedQuery(name = "Enquiry.findByMobile", query = "SELECT e FROM Enquiry e WHERE e.mobile = :mobile"),
    @NamedQuery(name = "Enquiry.findByNeedtype", query = "SELECT e FROM Enquiry e WHERE e.needtype = :needtype"),
    @NamedQuery(name = "Enquiry.findByExpecteddate", query = "SELECT e FROM Enquiry e WHERE e.expecteddate = :expecteddate"),
    @NamedQuery(name = "Enquiry.findByStatus", query = "SELECT e FROM Enquiry e WHERE e.status = :status")})
public class Enquiry implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "name", nullable = false, length = 50)
    private String name;
    @Column(name = "email", length = 50)
    private String email;
    @Column(name = "mobile", length = 50)
    private String mobile;
    @Basic(optional = false)
    @Column(name = "needtype", nullable = false, length = 50)
    private String needtype;
    @Basic(optional = false)
    @Column(name = "expecteddate", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date expecteddate;
    @Basic(optional = false)
    @Lob
    @Column(name = "description", nullable = false, length = 2147483647)
    private String description;
    @Basic(optional = false)
    @Column(name = "status", nullable = false)
    private boolean status;
    @JoinColumn(name = "idAccount", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Account idAccount;

    public Enquiry() {
    }

    public Enquiry(Integer id) {
        this.id = id;
    }

    public Enquiry(Integer id, String name, String needtype, Date expecteddate, String description, boolean status) {
        this.id = id;
        this.name = name;
        this.needtype = needtype;
        this.expecteddate = expecteddate;
        this.description = description;
        this.status = status;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getNeedtype() {
        return needtype;
    }

    public void setNeedtype(String needtype) {
        this.needtype = needtype;
    }

    public Date getExpecteddate() {
        return expecteddate;
    }

    public void setExpecteddate(Date expecteddate) {
        this.expecteddate = expecteddate;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public Account getIdAccount() {
        return idAccount;
    }

    public void setIdAccount(Account idAccount) {
        this.idAccount = idAccount;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Enquiry)) {
            return false;
        }
        Enquiry other = (Enquiry) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cabs.entity.Enquiry[id=" + id + "]";
    }

}
